home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr23 / chansw53.zip / CHAINSAW.TXT < prev    next >
Text File  |  1993-05-24  |  28KB  |  715 lines

  1. L---+---T1----+-T--2----T----3--T-+----4T---+---T5----+-T--R
  2. .X:10
  3. .XT:3
  4. .XB:2
  5. .H:
  6. .H:
  7. .H:
  8. .F:
  9. .F:
  10. .F:
  11. .F:
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                           CHAINSAW
  36.  
  37.            A command line driven directory pruner
  38.  
  39.              Public Domain, 5/24/93, Ted Davis
  40.  
  41.                         Version 5.3
  42.  
  43. 2
  44. .X:10
  45. .XT:3
  46. .XB:2
  47. .H:...CHAINSAW: overview
  48. .H:
  49. .H:
  50. .F:
  51. .F:
  52. .F:
  53. .F:...$$$...
  54. CHAINSAW is a command line driven directory pruner.  It does 
  55. not stop for user confirmation and can, therefore, readily 
  56. be used from batch files.  It can generate comprehensive 
  57. reports of its actions.
  58.  
  59.        It provides optional password protection to prevent 
  60. casual prowlers from using it to accidentally (or 
  61. intentionally) trash a disk or directory.  
  62.  
  63.        CHAINSAW is a cleaning tool, useful for a variety of 
  64. tasks from cleaning out the \temp directory of files,
  65. subdirectories, or both, to completely wiping an entire disk 
  66. during reconfiguration for a new user.  This program is 
  67. potentially destructive (as is FORMAT) and is intentionally 
  68. somewhat difficult to use in its most destructive modes.  It 
  69. is intended mostly for technicians, system administrators, 
  70. and power users.  It is NOT intended for novice users, who 
  71. are advised to leave it strictly alone. 
  72.  
  73.        The command line contains the complete path, 
  74. including drive, to the directory node at which the pruning 
  75. is to occur, a password (optional) and control switches 
  76. (also optional). Switches are provided to allow the program 
  77. to delete the files in the starting directory, and to remove 
  78. that directory, as well as all the subdirectories and their 
  79. contents, or just the subdirectories.  Other switches enable 
  80. operation on the root directory or network drives.  Another 
  81. group of switches control which of the program's messages 
  82. will be written and whether they go to STDOUT or STDERR.  
  83. Still other switches, used with a somewhat different syntax, 
  84. allow changing the password and default switches.
  85.  
  86.  
  87.        CHAINSAW is FREEWARE, placed in the public domain 
  88. 5/24/93 by the author, Ted Davis: it comes with absolutely 
  89. no warranty and the user's only recourse is refund of the 
  90. purchase price, which is nothing.  If you use this program, 
  91. you do so on your own responsibility.  If you don't want to 
  92. do that, erase your copy of the program RIGHT NOW. 
  93.  
  94.  
  95.        There is no formal support for the program, but you 
  96. do get the source code.  The author is not in a position to 
  97. provide support, but comments are welcome, as are 
  98. suggestions for improvements.  Since addresses and phone 
  99. numbers tend to change, but CompuServe ID numbers are 
  100. forever, I prefer to be contacted via CIS E-mail at 
  101. 73500,2314 (but do not expect a quick reply).  If you find 
  102. this program useful, please let me know how you are using 
  103. it, what features you use (and never use), etc.  I know how 
  104. I use it and how my beta testers use it, but the program has 
  105. a lot more in it that we routinely use.
  106. 3
  107. .H:...CHAINSAW: syntax, switches
  108. .H:
  109. .H:
  110. SYNTAX (most cases):
  111.  
  112. CHAINSAW {drive:path} {password} [switches] <Enter>
  113.  
  114. SYNTAX for changing default switches or password:
  115.  
  116. CHAINSAW {switch and new data} {password} <Enter>
  117.  
  118. (No matter what, the password must be the second item in the 
  119. command tail, unless suppressed.)
  120.  
  121. The default password can be found elsewhere in this manual.
  122.  
  123. The program responds to Ctrl + C and Ctrl + Break by 
  124. aborting with an ERRORLEVEL of 3 and a warning that some 
  125. damage may have been done to the given directory branch.
  126.  
  127. ------------------------------------------------------------
  128.  
  129. .H:...CHAINSAW: switches
  130. .H:
  131. .H:
  132. SWITCHES, general:
  133. Switches are introduced by a '/' or '-' character and 
  134. everything in the tail following the marker (except as noted 
  135. above) is considered a switch character or delimiter.  The 
  136. acceptable delimiters are '/', '-', ',', ';',  space, and tab.
  137. Incorrect or stray characters in the command tail cause the 
  138. program to bomb with an "if you don't know what you are 
  139. doing, don't do it" message.
  140.  
  141.        In the following sections, the default switches are 
  142. marked with an '*'. 
  143.  
  144.        Switches are processed in the order encountered, 
  145. defaults first, then those from the command tail, which can, 
  146. therefore, override the defaults.
  147.  
  148.  
  149. SWITCHES, permission:
  150. These enable or disable operations and locations.
  151.  
  152. f      Enables deletion of files in the starting directory.  
  153.        It is used to completely clean out a directory rather 
  154.        than just empty and remove its subdirectories.
  155.  
  156. F  *   Disables deletion of files in the starting directory.  
  157.        It is used to empty and remove the subdirectories of 
  158.        the starting directory while leaving the files in 
  159.        that directory intact.
  160.  
  161. g      Enables removal of the starting directory as well as 
  162.        all its contents, files as well as subdirectories.
  163.  
  164. G  *   Disables removal of the starting directory; only its 
  165.        subdirectories, and, optionally, files will be 
  166.        deleted.
  167.  
  168. 4
  169. n      Enables operations on network drives.
  170.  
  171. N  *   Disables operations on network drives.
  172.  
  173. p      Enables deletion of read-only, hidden, and system 
  174.        files in all permitted directories.
  175.  
  176. P  *   Disables deletion of read-only, hidden, and system 
  177.        files in all directories.
  178.  
  179. r      Enables operations in, but not on, the root 
  180.        directory, if it is the starting path.
  181.  
  182. R  *   Disables operations in the root directory.
  183.  
  184.  
  185. SWITCHES, message control
  186.  
  187.  
  188. ?, h, or H
  189.        Invokes the help screen, which is a VERY brief 
  190.        syntax and partial switch reminder.  No password is 
  191.        needed with this switch.
  192.  
  193. b      All messages are written to STDOUT, which can be 
  194.        redirected to a file or device.
  195.  
  196. B  *   Directs messages to their default destinations:
  197.        Fatal error messages to STDERR
  198.        Non-fatal error messages to STDOUT
  199.        Informational messages to STDOUT
  200.        File and directory deletion messages are not printed.
  201.  
  202. d      Enables directory removal listing to STDERR.
  203.  
  204. D      Enables directory removal listing to STDOUT.
  205.  
  206. e      Directs all messages to STDERR (the screen), which 
  207.        cannot be redirected.
  208.  
  209. E      Same as B.
  210.  
  211. l      Enables listing of deleted files to STDERR.
  212.  
  213. L      Enables listing of deleted files to STDOUT.
  214.  
  215. m      Directs all fatal and non-fatal error messages to 
  216.        STDERR without affecting informational and deletion 
  217.        messages.
  218.  
  219. M      Directs error messages to their default destinations.
  220.  
  221. 5
  222. o      Directs all fatal and non-fatal error messages to 
  223.        STDOUT without affecting informational and deletion 
  224.        messages.
  225.  
  226. O      Same as M.
  227.  
  228. s  *   Enables printing of a summary at termination.
  229.  
  230. S      Disables printing of the summary.
  231.  
  232. w  *   Turns the message output routine on.  This is needed 
  233.        only if the default has been changed to W.
  234.  
  235. W      Turns the message output routine off.  It is used in 
  236.        batch files instead of sending all the messages to 
  237.        STDOUT and redirecting it to NUL.
  238.  
  239. x      Turns off file deletion failure messages. 
  240.  
  241. X      Turns off directory removal failure messages.
  242.  
  243.  
  244. SWITCHES, default changing:
  245.  
  246. For all of these, except 'A', the new data string follows 
  247. the switch character without any delimiter.  If a password 
  248. is needed, it must follow the switch string and be separated 
  249. from it by at least one space.  The switch and string should 
  250. be the first command tail argument, the password, the 
  251. second.  No more than one of these switches can be used at a 
  252. time; the program terminates after processing the first one, 
  253. without even looking to see if there are more (well, almost 
  254. like that, it will process 'a' or 'A' even if the first 
  255. switch is 'z' or 'Z').  Although the default changing syntax 
  256. given above is the preferred form, it is possible to include 
  257. these switches in a normal command tail, but it is a waste 
  258. of effort since all that happens is the default change; the 
  259. program will not change defaults AND prune the directory on 
  260. the same pass.  Note: these write to the executable file, 
  261. but they still work if you rename the working copy of the 
  262. program.
  263.  
  264. a      Change default switch settings.  The string that 
  265.        follows the 'a' must be a legal switch string, it may 
  266.        contain '/' or '-' characters, but must not contain 
  267.        delimiters, unless the string is quoted.  Anything 
  268.        that would cause the string to be passed as more than
  269.        one argument will cause an error (bad password). 
  270.  
  271. A      Resets the original default switches, the ones marked 
  272.        with '*' in the preceding sections.
  273.  
  274. 6
  275. z      Changes the password to the string following the 'z'.
  276.        The next argument must be the existing password, if 
  277.        any.  This switch removes the password if the 'z' is 
  278.        followed immediately by a space.  Lower case 'z' 
  279.        clears the screen to remove the passwords from view.
  280.  
  281. .H:...CHAINSAW: switches, messages
  282. .H:
  283. .H:
  284. Z      Exactly like 'z' except that upper case 'Z' does not 
  285.        clear the screen.
  286.  
  287.  
  288. ------------------------------------------------------------
  289. .H:...CHAINSAW: messages
  290. .H:
  291. .H:
  292.  
  293. MESSAGES, general:
  294. On invocation, the program displays a copyright message to 
  295. STDOUT (unless the default is changed or overridden).  On 
  296. exit it displays a summary, the number of files deleted and 
  297. of directories removed to STDOUT (unless...).  In between, 
  298. it may or may not display some other message or list.  
  299.  
  300.        The messages texts are listed in alphabetical order 
  301. within categories.  Variable text is indicated by <type>.  
  302. The messages are not necessarily in exactly the same format 
  303. as they are on the screen since the screen is assumed to be 
  304. 80 columns and this text file is 60 columns wide.  
  305.  
  306.        Note that file and directory removal list messages 
  307. both begin with "... " and removal failure messages begin 
  308. with "*** ".  This allows easy separation and sorting of the 
  309. message stream with various utility programs.             
  310.  
  311.        The rather large number of switches controlling 
  312. message destinations are to allow generation of report files 
  313. with user determined contents.  A typical case would send 
  314. the list of file deletions to redirected STDOUT, suppress 
  315. directory deletion listing, and send everything else to the 
  316. screen (STDERR); another would send the error messages to 
  317. the file, information messages to the screen and suppress 
  318. the deletion messages.  In some batch file applications, any
  319. message would be useless and all display could be 
  320. suppressed. 
  321.  
  322. 7
  323. MESSAGES, informational:
  324.  
  325. ... Deleted file: <filespec>.
  326.  
  327.        Indicates that the named file was successfully 
  328.        deleted.  This message must be specifically enabled 
  329.        with the 'l' or 'L' switch.  It is invoked when the C 
  330.        function 'unlink' succeeds.  
  331.  
  332. ... Removed directory: <path>.
  333.  
  334.        Indicates that the named directory was successfully 
  335.        removed.  This message must be specifically enabled 
  336.        with the 'd' or 'D' switch.  It is invoked when the C 
  337.        function 'rmdir' succeeds. 
  338.  
  339.  
  340. CHAINSAW <version> deletes, without prompts, entire 
  341. branches of a directory tree. 
  342.  
  343. Syntax: CHAINSAW {path to base directory} {password} 
  344. {switches} or CHAINSAW <modification switch> <password> (The 
  345. drive letter is required, trailing '\' is optional.  
  346. Switches may be in /bde, /b/d/e, /b /d /e, /b,/d,/e, -bde, -
  347. b-d-e, -b -d -e, etc. format, so long as the first one 
  348. immediately follows a '/' or '-'.) 
  349.     There are too many switches to define all of them here, 
  350. but... /A restores default switches, /a changes them; 
  351. b,B,d,D,e,E,l,L,m,M,o,O,s,S, w,and W control the way the 
  352. program writes its messages (and what messages it writes).  
  353. For the rest of the listed switches, lower case enables and 
  354. upper case disables the feature: f,F - file deletion in the 
  355. base directory; g,G - base directory removal; n,N - 
  356. operation on network drives; p,P - deletion of read-only, 
  357. hidden and system files; r,R - operation on the root 
  358. directory; See CHAINSAW.DOC for details."
  359.  
  360.        The help screen is invoked by a '?', 'h', or 'H' 
  361.        switch. 
  362.  
  363. CHAINSAW aborted by user!  
  364. Directory <base path> and its subdirectories are probably 
  365. damaged.
  366.        Occurs when the user presses Ctrl + Break or 
  367.        Ctrl + C.
  368.  
  369. Chainsaw deleted <number or "no"> file<s> and removed 
  370. <number or "no"> directories.
  371.  
  372.        This is the summary message displayed at the end of 
  373.        the program.  Its presence is controlled by the 's' 
  374.        and 'S' switches.
  375.  
  376. 8
  377. CHAINSAW...New password installed.
  378.        This is the success message from the 'z' and 'Z' 
  379.        switches.  It indicates that no errors occurred 
  380.        during the process of encrypting the new password and 
  381.        writing the result to CHAINSAW.EXE.
  382.  
  383. CHAINSAW Version <version> is FREEWARE, Copyright 1992, Ted 
  384. Davis. 
  385.        This is the copyright message displayed when the 
  386.        program is invoked.   The 'w' and 'W' switches 
  387.        control its presence. 
  388.  
  389. New default switches installed.
  390.        This is the success message from the 'a' switch.  It 
  391.        indicates that there were no errors during the 
  392.        process of writing the new switch string to 
  393.        CHAINSAW.EXE.  It does not mean that the switch 
  394.        string makes sense or will work.
  395.  
  396. Original default switches reinstalled.
  397.        This is the success message from the 'A' switch and 
  398.        means that the original list of default switches has 
  399.        been written to CHAINSAW.EXE.
  400.  
  401.  
  402. MESSAGES, error:
  403. Let us hope that you see few or none of these (but you 
  404. will).  Some of these are followed by the appropriate DOS 
  405. error message which can be used to help determine the cause 
  406. of the error (maybe, if you have enough DOS interrupt 
  407. reference material and the message is meaningful).
  408.  
  409. *** Deletion of file: <filespec> failed.
  410.        'unlink' failed to execute properly.  The reason is 
  411.        likely to be obscure, perhaps a DOS error, the 
  412.        drive is not erasable or the disk is write protected, 
  413.        or the file is locked by another program on the 
  414.        network. 
  415.  
  416. *** Deletion of file: <filespec> failed.  Error: read-only, 
  417. hidden, or system.
  418.        The file attributes included one or more of those 
  419.        requiring special permission from the user for 
  420.        deletion.  The 'p' switch enables their deletion and 
  421.        prevents this message, except on write protected or 
  422.        read-only drives.
  423.  
  424. *** ERROR: <message>.
  425.        This follows another message and provides what the 
  426.        makers of DOS and of Turbo C++ think of as helpful 
  427.        explanations of a DOS interrupt function failure.  
  428.        These messages are often useless, misleading, and/or 
  429.        cryptic but may be helpful to DOS experts and power 
  430.        users. 
  431.  
  432. 9
  433. *** Removal of directory: <path> failed.
  434.        'rmdir' failed to execute properly.  The most likely 
  435.        reason is that the directory, or one of its 
  436.        subdirectories is not empty, perhaps due to hidden, 
  437.        read-only, or system files that were not erased 
  438.        because you did not use the 'p' switch or an erasure 
  439.        failure.  
  440.  
  441.  
  442. DOS 3.0 or later is required.
  443.        This message is self explanatory; the only cure is to 
  444.        upgrade your version of DOS, which you probably 
  445.        should have done anyway when DOS 5.0 came out.
  446.  
  447. Memory allocation ERROR, CHAINSAW aborted.
  448.        This means either that the directory tree has too 
  449.        many subdirectories on the branch in work or that a 
  450.        DOS memory allocation error occurred.  CHAINSAW 
  451.        creates (and allocates memory for) a new instance of 
  452.        the 'dirkiller' object for the base directory and for 
  453.        each level of subdirectories within it.  This message 
  454.        occurs when the 'new' operator fails.
  455.  
  456. Password incorrect of file read error... CHAINSAW aborted.
  457.        The most usual causes are a typo in the password and
  458.        omission of all or part of the command tail.  It can 
  459.        also occur if CHAINSAW.EXE becomes corrupted or 
  460.        cannot find itself.
  461.  
  462. Unable to change password.
  463.        This means that there was an error writing the new 
  464.        password to CHAINSAW.EXE, or in finding the existing 
  465.        one in the file.  Make sure that CHAINSAW.EXE is not 
  466.        marked read-only, that the disk is not write 
  467.        protected, and if on a network, that you have write 
  468.        permission for the directory in which it resides.  If 
  469.        none of that helps, it will be necessary to start 
  470.        over with an unmodified copy of the program as 
  471.        distributed.    
  472.  
  473. Unable to change switches.
  474.        This means that there was an error writing the new 
  475.        switches to CHAINSAW.EXE, or in finding the existing 
  476.        ones in the file.  Make sure that CHAINSAW.EXE is not 
  477.        marked read-only, that the disk is not write 
  478.        protected, and if on a network, that you have write 
  479.        permission for the directory in which it resides.  If 
  480.        none of that helps, it will be necessary to start 
  481.        over with an unmodified copy of the program as 
  482.        distributed. 
  483.  
  484. 10
  485. The calling syntax for CHAINSAW was incorrect...
  486. If you do not FULLY understand the syntax and what the 
  487. program does you should not attempt to use it.  This program  
  488. DESTROYS ENTIRE BRANCHES OF THE DIRECTORY TREE.
  489. If used incorrectly, it can do untold damage.
  490.        This is the barf message: there was something on, or 
  491.        missing from, the command line that the parser did 
  492.        not like.  Its primary purpose is to discourage 
  493.        browsers while protecting your hard disk(s).  In 
  494.        practice, you will get it most often by forgetting 
  495.        to include the entire command tail when invoking the 
  496.        program: CHAINSAW <Enter> will get it for you.  The 
  497.        absolute minimum command tail contains the complete 
  498.        path, including drive, to the starting directory, and 
  499.        unless you have turned off the password feature, the 
  500.        password.
  501.  
  502. 11
  503. .H:...CHAINSAW: ERRORLEVELS, SAFETY
  504. .H:
  505. .H:
  506.  
  507. ERRORLEVELS:
  508. CHAINSAW returns an exit code which can be read and acted 
  509. upon by a calling batch file with the IF ERRORLEVEL test. 
  510.  
  511.        ERRORLEVEL == 0 - Normal termination: everything went 
  512.                          OK, no problems. 
  513.        ERRORLEVEL == 1 - aborted due to some internal error 
  514.                          or command tail syntax error.
  515.        ERRORLEVEL == 2 - ran to completion, but failed to 
  516.                          delete one or more files or 
  517.                          directories.  
  518.        ERRORLEVEL == 3 - user aborted with Ctrl + Break or 
  519.                          Ctrl + C. 
  520.        ERRORLEVEL == 4 - HELP message was displayed.
  521.        ERRORLEVEL == 5 - Password or default switches 
  522.                          changed, message indicates success 
  523.                          or failure.
  524.  
  525. ------------------------------------------------------------
  526.  
  527. SAFETY and SECURITY:
  528.  
  529. Most directory pruners either stop and demand confirmation 
  530. from the operator before deleting anything (some prompt for 
  531. everything) or are quick knock-offs that should never leave 
  532. the authors hands.  CHAINSAW is neither.  It is thoroughly 
  533. thought out and tested, and while it does not prompt for 
  534. confirmation, it does have password protection to prevent 
  535. unauthorized use and a rather elaborate set of switches to 
  536. either protect or unprotect such critical areas as the root 
  537. directory; read-only, hidden, and system files; and network 
  538. drives.  For those (such as the target user) who are 
  539. determined to make it easy for casual browsers to trash 
  540. their hard disks, the password feature can be turned off, if 
  541. you have the password.  NOTE: the default password is 
  542. "password" (lower case, no quote marks).  I buried that here 
  543. so that the potential user must at least scan the manual 
  544. before using the program. 
  545.  
  546.        For those users who are concerned about viruses:
  547. when released, the program was clean, and CIS has a very 
  548. good reputation for virus free software.  Nevertheless,
  549. the best possible protection is to read, understand, and 
  550. recompile the source code.  It was written using Turbo C++ 
  551. PRO (the PRO is important because the inline assembly 
  552. requires TASM and TASM2MSG, which are included in the 
  553. package) with the small memory model.  The only problems to 
  554. be expected with other C++ compilers would be with library 
  555. function names and the inline assembly code.  Most compilers 
  556. have equivalent functions and many have some way to deal 
  557. with inline assembly.  In case yours doesn't, you are on 
  558. your own.  Versions after Beta 5.2 were compiled with 
  559. Borland C++ for DOS.
  560.  
  561. 12
  562. .H:...CHAINSAW: more about
  563. .H:
  564. .H:
  565.  
  566. More about CHAINSAW:
  567.  
  568. Most of the code is pure C, but the real business of the 
  569. program, recursion through the directory tree, file 
  570. deletion, and directory removal uses a C++ class named 
  571. 'dirkiller' which consists of a data block and a 
  572. constructor.  Construction of the object performs its work.  
  573. When the active instance of dirkiller encounters a 
  574. subdirectory, it creates a new instance of itself to process 
  575. it.  Each instance is destroyed (and removed from memory) 
  576. when it finishes.  This is not true recursion, it is in many 
  577. ways better.  The network drive test is implemented mostly 
  578. in assembly, and is built around DOS interrupt 0x21, 
  579. function 0x44, subfunction 0x09 which reports whether a 
  580. given drive is local or remote.  The source code is heavily 
  581. commented, except for the password changing and reading 
  582. functions.
  583.  
  584.        The program uses the small memory model, which 
  585. accounts for some of the apparently unneeded code that 
  586. processes the command tail arguments.  They seem to be 
  587. represented by far pointers and cannot be passed to 
  588. functions without a lot of trouble, or a different, and 
  589. slower, memory model.
  590.  
  591.        This program grew out of a co-worker's need for a 
  592. program to remove a bunch of subdirectories created by a 
  593. batch file.  It needed to work from the batch file without 
  594. operator intervention.  After a bit of research and a lot of 
  595. thinking about the problem, I decided to write a generalized 
  596. command line pruner for public distribution as freeware.  
  597. Obviously, that requires both more features and at least 
  598. some protection from accidental disk trashing.  It grew, and 
  599. grew, and grew.  There are several more features that I 
  600. would like to add, such as a switch to allow exclusion of 
  601. specified sub-branches of the target directory, and another 
  602. to exclude, as non-overrideable defaults, specified 
  603. directories and branches (such as C:\ and C:\DOS); but I had 
  604. to draw the line somewhere.  If there is a demand for them, 
  605. I will produce a version with those, and/or other, features.  
  606. If you want something really customized, I am willing to 
  607. talk money. 
  608.  
  609. T.E.D.  1/11/92
  610.  
  611.  
  612. 13
  613.                  Addenda 3/4/93 and 5/24/93
  614.  
  615. This program has been in almost daily use by a PC support 
  616. group (over 50 PCs) for over a year.  Most of the bugs 
  617. have been exterminated and usage patterns have formed and 
  618. have been analyzed. There has been only one change to the 
  619. dirkiller object in over six months, and it was rather minor 
  620. (to handle the special case of removing an already empty 
  621. directory (why anyone would use CHAINSAW instead of 
  622. RD for that completely escapes me)).  
  623.  
  624.         The uses of the program fall into a few distinct 
  625. classes:
  626. l---+---l-----+-L--2----T----3--T-+----4T---+---T5----+-T--R
  627.         1)      A password protected copy in the network 
  628.                 search path is used mostly to strip out old 
  629.                 installations of user software before 
  630.                 upgrade or reinstallation and to clean out 
  631.                 user's c:\temp directories that get filled 
  632.                 up with batch files left by DOSSHELL when 
  633.                 the user reboots without dropping the 
  634.                 program.  I took over a hundred out of one 
  635.                 professor's \temp directory.  CHAINSAW is 
  636.                 preferred because it cleans out the 
  637.                 directory completely, including removal of 
  638.                 subdirectories, which DEL *.*, with its 
  639.                 annoying "Are you sure" prompt doesn't do.
  640.  
  641.         2)      Unprotected copies in the technicians' 
  642.                 individual paths (ahead of the global copy) 
  643.                 are used frequently for the original purpose 
  644.                 of the program: to clean up after shuffling 
  645.                 files through a \temp directory. 
  646.  
  647.         3)      We use the same unprotected copies to delete 
  648.                 dead directories and unwanted program 
  649.                 installations, as after testing a new 
  650.                 program. 
  651.  
  652.         4)      An unprotected copy on the same floppy as a 
  653.                 batch file is used to remove everything 
  654.                 except authorized files from lab and student 
  655.                 machines.  The batch file marks the allowed 
  656.                 files as read-only and CHAINSAW is not 
  657.                 allowed to delete them.  It also writes a 
  658.                 report of what it removed and did not remove 
  659.                 to STDOUT which is redirected to a data file 
  660.                 on the floppy.  The DOS FIND service then 
  661.                 separates the removals and non-removals into 
  662.                 separate files for analysis.  The batch file 
  663.                 also cleans up after itself by removing the 
  664.                 read-only marks from those files that are 
  665.                 not supposed to be read-only.
  666. 14
  667.  
  668.         5)      I use it to strip entire drives down to the 
  669.                 volume label in preparation for installing a 
  670.                 new version of DOS and a set of standard 
  671.                 programs as part of a procedure for 
  672.                 refurbishing old machines for new users.
  673.  
  674.         6)      We also carry it around to non-networked lab 
  675.                 machines to clean up students working 
  676.                 directories after they graduate (or 
  677.                 otherwise leave).  A few of these machines 
  678.                 are networked - and we use our own copies or 
  679.                 the protected "public" copy instead of 
  680.                 carrying a floppy around. 
  681.  
  682. L---+----T----+----2----T----3--T-+----4T---+---T5----+-T--R
  683.  
  684.          The report generation code, on which I spent so 
  685. much time, is used only during the pre-semester cleanup 
  686. sweep.  The password feature is used only for the copy that 
  687. anyone can access over the network (of course, the other 
  688. copies are either kept filed away on floppies in drawers or 
  689. are protected by our network login passwords).
  690.  
  691.          I cannot say that the program is perfect or 
  692. bullet proof but, in over a year of use and testing, it has 
  693. never removed anything it wasn't told to remove.  There have 
  694. been malfunctions, but they have all been benign - they 
  695. have resulted in something not being removed or the program 
  696. refusing to do anything at all; these have all been fixed. 
  697. See CHAINSAW.CPP for the version history.
  698.  
  699.          One or two last notes: I thought it was 
  700. malfunctioning when it refused to remove c:\windows\fungame 
  701. from my own machine at home.  I had momentarily forgotten 
  702. that a SUBST was in effect for that directory (as drive F:).  
  703. DOS refused to let CHAINSAW remove what it thought of as a 
  704. root directory.  Even with the permission switch on, I got 
  705. the general ERROR message with the explanation that access 
  706. was denied.  I did once get a "Protected Mode Violation" 
  707. error from Windows 3.1 (in standard mode on a PS2-30/286), 
  708. but I get those all the time).  No, I will not explain why I 
  709. am trying to support Windows and Windows apps with a brain-
  710. damaged computer.   The program has not been tested under 
  711. DOS 6.0; we were smart enough to pass on that one, so I 
  712. don't have access to it.
  713.  
  714. T.E.D.
  715.